<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $artykul = new Application_Model_DbTable_Article();
        $w = $artykul->select()->where('dzial = ?', 'index');
        $r= $artykul->fetchRow($w);
        $this->view->artykul = $r->toArray();
        
    }

    public function informacjeAction()
    {
        $artykul = new Application_Model_DbTable_Article();
        $w = $artykul->select()->where('dzial = ?', 'info');
        if($w != NULL){
			$this->view->artykul = $artykul->fetchRow($w)->toArray();
		}
		else{
			$this->view->artykul = array('name' => 'Strona w budowie', 'content' => '');
		}
    }

    public function spisAction()
   {
        $artykul = new Application_Model_DbTable_Article();
        $w = $artykul->select()->where('dzial = ?', 'spis');
		$r = $artykul->fetchRow($w);
		if($r != NULL){
			$this->view->artykul = $r->toArray();
		}
		else{
			$this->view->artykul = array('name' => 'Strona w budowie', 'content' => '');
		}
    }

    public function sprawozdaniaAction()
   {
        $artykul = new Application_Model_DbTable_Article();
        $w = $artykul->select()->where('dzial = ?', 'sprawo');
		$r = $artykul->fetchRow($w);
		if($r != NULL){
			$this->view->artykul = $r->toArray();
		}
		else{
			$this->view->artykul = array('name' => 'Strona w budowie', 'content' => '');
		}
    }

    public function swiatAction()
   {
        $artykul = new Application_Model_DbTable_Article();
        $w = $artykul->select()->where('dzial = ?', 'swiat');
		$r = $artykul->fetchRow($w);
		if($r != NULL){
			$this->view->artykul = $r->toArray();
		}
		else{
			$this->view->artykul = array('name' => 'Strona w budowie', 'content' => '');
		}
    }

    public function zapowiedziAction()
   {
        $artykul = new Application_Model_DbTable_Article();
        $w = $artykul->select()->where('dzial = ?', 'zapowiedzi');
		$r = $artykul->fetchRow($w);
		if($r != NULL){
			$this->view->artykul = $r->toArray();
		}
		else{
			$this->view->artykul = array('name' => 'Strona w budowie', 'content' => '');
		}
    }

    public function kontaktAction()
   {
        $artykul = new Application_Model_DbTable_Article();
        $w = $artykul->select()->where('dzial = ?', 'kontakt');
		$r = $artykul->fetchRow($w);
		if($r != NULL){
			$this->view->artykul = $r->toArray();
		}
		else{
			$this->view->artykul = array('name' => 'Strona w budowie', 'content' => '');
		}
    }


}













